#include <stdio.h>
#include <iostream>

using std::cout;
using std::endl;

//作用域与可见域(屏蔽现象)
int number = 10;
int a = 20;

namespace wd
{
int number = 200;

void print(int number)
{
    cout << "形参number = " << number << endl;
    cout << "命名空间wd中number = " << wd::number << endl;
    cout << "全局变量number = " << ::number << endl;//匿名命名空间
    cout << "a = " << a << endl;
    cout << "a = " << ::a << endl;
    printf("hello,world\n");
    ::printf("hello,world\n");
}

}//end of namespace wd

namespace wh
{
int number = 300;

void print()
{
    cout << "void wh::print()" << endl;
}

//命名空间的嵌套
namespace hb
{
int number = 500;
}//end of namespace hb

}//end of namespace wh

int main(int argc, char **argv)
{
    wd::print(300);
    cout << "number = " << wh::hb::number << endl;

    return 0;
}

